<?php
$dirname = dirname(__FILE__);
include_once $dirname . "/inc/common.php";
include_once $dirname . "/inc/header.php";

if(!isset($_SESSION['login']['ID']))
{	// not logged in
	include_once $dirname . "/pages/home.php";
}
elseif(isset($_SESSION['webshop']['ID']) && !empty($_SESSION['webshop']['ID']) && is_numeric($_SESSION['webshop']['ID']))
{
	// webshop selected
	if(!isset($_SESSION['menu']['page']))
		$_SESSION['menu']['page'] = 'profiel';
	switch($_SESSION['menu']['page'])
	{
		case 'datafeed':
			include_once $dirname . "/pages/webshopDatafeed.php";
			break;
				 
		case 'products':
			include_once $dirname . "/pages/webshopProducts.php";
			break;
				
		case 'statestieken':
			include_once $dirname . "/pages/webshopStatistics.php";
			break;
				 
		case 'profiel':
			include_once $dirname . "/pages/webshopProfile.php";
			break;
			
			
			
				
		default:
			include_once $dirname . "/pages/webshop.php";		
			break;
	}
}
else
{	// account overview
	include_once $dirname . "/pages/webshopSummary.php";
}
include_once $dirname . "/inc/footer.php";